:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f7ff;
    min-height: 100vh;
    padding: 2rem;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.app-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
}

.app-header h1 {
    font-weight: 600;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.app-header p {
    opacity: 0.9;
    font-weight: 300;
}

.app-content {
    padding: 2rem;
}

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.section-title svg {
    margin-right: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #4263eb;
    outline: none;
}

/* 输入验证样式 */
.form-control.error {
    border-color: var(--danger);
    background-color: rgba(247, 37, 133, 0.05);
}

.form-control.valid {
    border-color: var(--success);
    background-color: rgba(76, 201, 240, 0.05);
}

/* 错误提示样式 */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--danger);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
    min-width: 120px;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: #4263eb;
    color: white;
}

.btn-primary:hover {
    background: #364fc7;
}

.btn-danger {
    background: #e03131;
    color: white;
}

.btn-danger:hover {
    background: #c92a2a;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.response-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-top: 2rem;
    border-left: 4px solid var(--primary);
}

.response-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
}

.response-content {
    min-height: 100px;
    padding: 1rem;
    background-color: var(--light);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.video-preview {
    width: 100%;
    max-width: 640px;
    margin: 1rem auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--light);
}

.video-preview video {
    width: 100%;
    display: block;
}

.notice {
    padding: 1.5rem;
    background-color: var(--light);
    border-radius: var(--border-radius);
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.notice-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.notice-list {
    padding-left: 1.2rem;
}

.notice-list li {
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .app-content {
        padding: 1.5rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

.icon {
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.btn .icon {
    margin-right: 0.5rem;
}

/* 视频容器样式 */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.video-controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #e9ecef;
}

#cameraSelect {
    min-width: 200px;
}

#videoElement {
    width: 100%;
    height: auto;
    display: block;
}

.timer {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* 弹幕容器样式 */
.danmaku-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.danmaku-list {
    position: relative;
    width: 100%;
    height: 100%;
}

.danmaku {
    position: absolute;
    white-space: nowrap;
    color: #333;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    animation: danmaku-move 8s linear;
    pointer-events: none;
}

.danmaku.error {
    color: #ff4444;
}

@keyframes danmaku-move {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* 历史记录容器样式 */
.history-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}

.history-list {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.history-entry {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary);
}

.history-entry.error {
    border-left-color: var(--danger);
}

.history-timestamp {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.history-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark);
}

/* 滚动条样式 */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #555;
} 